// FirstClient_boost.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include "asio.hpp"
#include "shared_ptr.hpp"
#include "boost\thread\thread.hpp"

using namespace boost::asio;
typedef boost::shared_ptr<ip::tcp::socket> socket_ptr;

void connect_handler(const boost::system::error_code &ec)
{
	printf("connect_handler ec=%s", ec.message().c_str());
}
int _tmain(int argc, _TCHAR* argv[])
{
	io_service service;
	ip::tcp::endpoint ep(ip::address::from_string("127.0.0.1"), 2001);
	ip::tcp::socket sock(service);
	sock.async_connect(ep, connect_handler);
	service.run();
	while (getchar() != 'q')
	{
		continue;
	}
	return 0;
}

